package com.zb.system.controller;


import com.zb.result.PageUtil;
import com.zb.result.Result;
import com.zb.service.ZjCustomerWxAuthorService;
import com.zb.utils.TokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 商家微信授权认证表 前端控制器
 * </p>
 *
 * @author WEN
 * @since 2024-03-01
 */
@Api(tags = "商家微信类接口")
@RestController
@RequestMapping("/customer/wx/author")
public class ZjCustomerWxAuthorController {
    @Resource
    private ZjCustomerWxAuthorService customerWxAuthorService;

    @ApiOperation("获取商家微信授权信息")
    @GetMapping("/getCustomerWxAuthor")
    public Result getCustomerWxAuthor(HttpServletRequest request) {
        Long custAccId = TokenUtil.getcustAccIdByToken(request);
        return Result.success("获取商家微信授权信息成功").data(PageUtil.row(customerWxAuthorService.getCustomerWxAuthor(custAccId)));
    }


}
